package HDFSTest;

public class Data<T> {
	protected long location;
	protected long size;
	protected T content;

	public Data(long location, long size, T content) {
		this.location = location;
		this.size = size;
		this.content = content;
	}

	public Data(long location, long size) {
		this(location, size, null);
	}

	public long getLocation() {
		return location;
	}

	public long getSize() {
		return size;
	}

	public T getContent() {
		return content;
	}

	public boolean equals(Object other) {
		if (!(other instanceof Data))
			return false;
		Data<?> otherData = (Data<?>) other;
		boolean contentBool = true;
		if (content != null)
			contentBool = content.equals(otherData.getContent());
		return location == otherData.getLocation() && contentBool;
	}
}
